import { reactive } from 'vue'

export default function usePagination({ current = 1, pageSize = 10, total = 0}){
  const pagination = reactive({
    current: current,
    pageSize: pageSize,
    total: 0,
  })

  function handleCurrentChange(val) {
    pagination.current = val
  }

  function handleSizeChange(val) {
    pagination.pageSize = val
  }

  return {
    pagination,
    handleCurrentChange,
    handleSizeChange
  }

}
